import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "@/mock/mockServe";
Vue.config.productionTip = false;
import NavBar from "@/components/NavBar";
import Carousel from "@/components/Carsouel";
import Scroll from "@/components/scroll";
import TabControl from "@/components/tabControl";
import GoodsList from "components/GoodList";
import { Message } from "element-ui";
import { MessageBox } from "element-ui";
import toast from "components/Toast";
import "swiper/css/swiper.css";
import "element-ui/lib/theme-chalk/index.css";
//解决移动端300ms
import FastClick from "fastclick";
import lazyload from "vue-lazyload";
FastClick.attach(document.body);
Vue.component(NavBar.name, NavBar);
Vue.component(Scroll.name, Scroll);
Vue.component(TabControl.name, TabControl);
Vue.component(Carousel.name, Carousel);
Vue.component(GoodsList.name, GoodsList);
// 安装toast插件
Vue.use(toast);
Vue.use(lazyload, { loading: require('./assets/img/loading-bars.svg') })// 注意路径使用require（我这里使用相对路径） });
Vue.prototype.$message = Message;
Vue.prototype.$confirm = MessageBox.confirm;
new Vue({
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
